package com.qr.mp.config;

import com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator;
import com.qr.mp.plugins.MyInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Configuration
@MapperScan("com.qr.mp.mapper")
public class MybatisPlusConfig {

    //Oracle序列生成器
    @Bean
    public OracleKeyGenerator oracleKeyGenerator(){
        return new OracleKeyGenerator();
    }

    /**
     * 注入自定义拦截器
     * @return
     */
    @Bean
    public MyInterceptor myInterceptor(){
        return new MyInterceptor();
    }

}
